<?php
switch ($_REQUEST['sAction']) {
	case 'issue-accept':
		$iResult = IssueHandler::acceptIssue($_REQUEST['iJob'], $_REQUEST['iIssue'], $_REQUEST['iMissiongroup'], $_REQUEST['sTodo']);
		if ($iResult > 0) {
			header('MiJob-Action: success');
			header('Location: index.php?sView=job-view');
			exit();
		}
		break;
	case 'issue-add':
		$iResult = IssueHandler::addIssue($_REQUEST['iJob'], $_REQUEST['iReceiver'], $_REQUEST['sBody']);
		header('MiJob-Message: !'.$iResult.'!');
		if ($iResult > 0) {
			header('MiJob-Action: success');
			header('Location: index.php?sView=job-public');
			exit();
		}
		break;
	case 'issue-deny':
		$iResult = IssueHandler::denyIssue($_REQUEST['iJob'], $_REQUEST['iIssue']);
		if ($iResult == 1) {
			header('MiJob-Action: success');
			header('Location: index.php?sView=job-view');
			exit();
		}
		break;
}
?>
